package org.gogenie.android.ui;

import org.gogenie.android.model.Post;

import uy.com.silveira.noname.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/**
 * @author jjso
 */
public class AwesomeActivity extends Activity {

  private OnClickListener newClickListener = new OnClickListener() {
    public void onClick(View arg0) {
      openChooseActivity();
    }
  };

  private OnClickListener exitClickListener = new OnClickListener() {
    public void onClick(View arg0) {
      moveTaskToBack(true);
    }
  };

  private void openChooseActivity() {
    Post newPost = new Post();
    Intent openChooseActvity = new Intent(this, InputChoiceActivity.class);
    openChooseActvity.putExtra(InputChoiceActivity.EXTRA_POST, newPost);
    startActivity(openChooseActvity);
  }

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.awesome);
    ((Button)findViewById(R.id.new_btn)).setOnClickListener(newClickListener);
    ((Button)findViewById(R.id.exit_btn)).setOnClickListener(exitClickListener);
  }
}
